<?php
	$urlRead = "index.php?message&type=allReadMessages";
	$urlDelete = "index.php?message&type=delete";	
?>
<div style="margin-left:60px; margin-top:10px; line-height:1.2em">
	Tổng cộng <b><?php echo $nTotalReadMessage;?></b> tin nhắn				
</div>
<?php	
	foreach ($arrMess as $mess) {		
		$img = $imgs[$mess->getSenderID()];
		$user = $arrUser[$mess->getSenderID()]; 
?>	
<div class="oneComment" id="mess<?php echo $mess->getMessageID()?>">
    <div class="avatar">
    	<img src="<?php echo $ubi['SERVER']['THUMBNAIL_PATH'] . "/" . $img ?>" /><br />
    	<a href="index.php?view&type=user&userid=<?php echo $user->getUserID(); ?>">
    		<?php echo $user->getUsername()?>
    	</a>		
    </div>
    <div class="comment_content">
    	<div style="float:left">
    		<div class="date"><?php echo date('d/m/Y', $mess->getCreatedDate()) ?></div>
    	</div>
    	<div style="float:right;">
    		<a href="#allReadMessages" 
        		onclick="$.deleteMessage('<?php echo $mess->getMessageID()?>', '<?php echo $urlDelete?>', '<?php echo $urlRead?>')">
        		<img src="include/images/icons/circle-delete.png" />
        	</a>
    	</div>
    	<div class="clear"></div>
    	<div class="title"><?php echo $mess->getTitle() ?></div>    	
    	<?php echo $mess->getContent()?>    	    	
    </div>
    <div class="clear"></div>
</div>
<?php
	} 
?>
<div class="page">
	Trang : 
	<?php
		
		for ($i = 0; $i < $numberOfPages; $i++) {
			if ($i + 1 != $getVars['page']) {
	?>
			<a href="#allReadMessages" onclick="$.viewPage('<?php echo $i + 1 ?>')"><?php echo $i + 1 ?></a>&nbsp;
	<?php 
			} else {
				?>
				<b><a href="#allReadMessages" onclick="$.viewPage('<?php echo $i + 1 ?>')"><?php echo $i + 1 ?></a></b>&nbsp;
				<?php
			}
		} 
	?>
</div>